package com.example.dongha.bar.listener;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * Created by liangkun on 2018/8/9.
 * 作用:
 */

public class DateUtil {
    public static String getDate(int i) {
        Calendar c = Calendar.getInstance();
        c.setTime(new Date());
        c.add(Calendar.DAY_OF_MONTH, -30);
        c.setTime(c.getTime());
        c.add(Calendar.DAY_OF_MONTH, i+1);
        SimpleDateFormat sdf = new SimpleDateFormat("MM/dd");

        String dateStr = sdf.format(c.getTime());
        return dateStr;
    }
}
